package com.qk.mapper;

import com.qk.entity.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleMapper {
     List<Role> selectList(String name, String label);

    @Delete( "delete from role where id = #{id}")
    void deleteById(Integer id);

    @Insert("insert into role(name, label, remark, create_time, update_time) values (#{name},#{label},#{remark},#{createTime},#{updateTime})")
    void insertRole(Role role);
    @Select("select id, name, label, remark, create_time, update_time from role where id = #{id}")
    Role selectRoleById(Integer id);
    //根据id修改角色信息

    void updateRole(Role role);

    @Select("select id, name, label, remark, create_time, update_time from role")
    List<Role> selectAllRole();
}

